<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/res/back/css/base.css" rel="stylesheet" type="text/css" />
<link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
<script src="/res/third/bootstrap3/bootstrap.autocomplete.js" type="text/javascript"></script>
<script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
<script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>
<script src="/res/third/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/res/third/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
	function sosuo() {
		var lpath = location.pathname;
		$("#soform").attr("action", lpath + "?pageNo=" + 1);
		$("#soform").submit();
	}
</script>
<style type="text/css">
.panel.panel-content{
	overflow-y: scroll;
}
</style>

</head>

<body>
	<div class="panel panel-info panel-content">
		<div class="panel-heading">
			<button type="button" onclick="exportChecked()" class="btn btn-info">
				&nbsp;导出已选择的申请
			</button>
		</div>
		<table class="table table-hover table-bordered table-striped table-condensed">
			<thead>
				<tr>
					<th><input type="checkbox" id="checkAll" onclick="checkAll()"/></th>
					<th>公司名称</th>
					<th>联系人</th>
					<th>联系电话</th>
					<th>经营品牌</th>
					<th>合作意向</th>
					<th>备注内容</th>
					<th>申请时间</th>
					<th>操作</th>
				</tr>
			</thead>
			[#list pagination.list as memberapply ]
			<tr>
				<td align="center"><input type="checkbox" value="${memberapply.id}" class="checkitem"/></td>
				<td align="center">${memberapply.companyName!}</td>
				<td align="center">${memberapply.contacts!}</td>
				<td align="center">${memberapply.tel!}</td>
				<td align="center">${memberapply.brands!}</td>
				<td align="center" style="max-width: 382px">${memberapply.coopIntention!}</td>
				[#--<td align="center">
					[#if (memberapply.auditState!0) == 1]同意[/#if]
					[#if (memberapply.auditState!0) == 2]拒绝[/#if]
					[#if (memberapply.auditState!0) == 0]待审核[/#if]
				</td>--]
				<td align="center">${memberapply.auditOpinion!}</td>
				<td align="center">${(memberapply.createtime?datetime)!}</td>
				<td style="text-align: center"><input type="button" onclick="exeplain('${memberapply.id}')"  style="font-size: 10px;" class="btn btn-info" value="备注"></td>
			</tr>
			[/#list]
		</table>
		<div class="panel-footer">[@fenye p = pagination form = 'infoForm' /]</div>
	</div>
	<form id="exportExcel" action="exportMemberApplyExcel.do">
		<input type="hidden" name="ids" id="ids"/>
	</form>

	<div  id="editorView" style="display: none;">
		<form  id="signupForm" class="form-horizontal"  method="post" role="form">
		<div style="width: 400px;height: 150px;">
			<input type="hidden" name="id" id="setId">
			<textarea id="auditOpinion" name="auditOpinion"  style="width: 100%;height: 100px;"></textarea>
			<button type="button" class="btn btn-success btn-xs delbtn" onclick="insertDesc()">确认</button>
		</div>
		</form>
	</div>

</body>
</html>
<script type="text/javascript">
//全选方法

/*var aId;
var desc;*/
function exeplain(id){
    $("#setId").val(id);
	dialog = art.dialog({
		title: "备注",
		lock : true,
		content:document.getElementById("editorView")
	});

}

function insertDesc(){
	     var auditOpinion = $("#auditOpinion").val().trim();
	     if(auditOpinion==""){
	    	 alert("请填写意见");
	    	 return false;
	     }else{
		    	 art.dialog.post({
						url : '/company/insertDesc.do',
						type : 'post',
						dataType : 'json',
						data :$("form").serialize(),
						beforeSend:function(){
				            art.dialog.tips("处理中...");
				        },
						success : function(data){
							if(data.success){
								alert(data.msg);
								location.reload();
							}else{
								error_msg(data.msg , function(){location.reload();});
							}
						}
				 
				},"数据正在处理中.... ");
	     }
}
function checkAll(){
	var setchecked = false;
	if($("#checkAll").is(":checked")){
		setchecked=true;
	}
	$(".checkitem").each(function(){
		$(this)[0].checked =setchecked;
	})
}

function exportChecked(){
	var ids="";
	$(".checkitem").each(function(){
		if($(this)[0].checked){
			ids+= ($(this).val()+",");
		}
	});
	if(ids==""){
		alert("至少选择一条合作申请！")
	}else{
		ids = ids.substr(0,ids.length-1);
		$("#ids").val(ids);
		$("#exportExcel").submit();
	}
}
</script>

